package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.BasePageInfo;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.MarketFeedback;
import com.cskaoyan.bean.param.CommonData;
import com.cskaoyan.service.admin.MarketFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LC_RSH
 * @date 2022/6/26 14:57
 */
@RestController
@RequestMapping("admin/feedback")
public class AdminFeedbackController {
    @Autowired
    MarketFeedbackService feedbackService;

    /**
     * 通过usename和id展示意见
     * @return 意见列表
     * @author LC_R-SH
     * @since 2022/06/26 15:02
     */
    @RequestMapping("list")
    public BaseRespVo list(String username, String id, BasePageInfo info) {
        Integer userId = 0;
        if (id != null && id != "") {
            try {
                userId = Integer.parseInt(id.trim());
            } catch (Exception e) {
                return BaseRespVo.invalidParameter("无效参数");
            }
        }
        CommonData<MarketFeedback> data = feedbackService.query(username, userId, info);
        return BaseRespVo.ok(data);
    }
}

/**
 * 意见反馈
 *
 * @author 86157
 * @since 2022/06/26 14:57
 */